package com.sunzm.dynamic_rule.utils;

import com.sunzm.dynamic_rule.pojo.LogBean;
import com.sunzm.dynamic_rule.pojo.RuleParam;
import com.sunzm.dynamic_rule.pojo.RuleStateBean;
import com.sunzm.dynamic_rule.pojo.RuleStateBean2;
import org.apache.flink.api.common.state.ListStateDescriptor;
import org.apache.flink.api.common.state.MapStateDescriptor;

/**
 * 定义状态描述器的工具类
 *
 * @author Administrator
 * @version 1.0
 * @date 2021-07-19 0:27
 */
public class StateDescUtil {
    /**
     * 存放drools规则容器session的state定义器
     */
    public static final MapStateDescriptor<String, RuleStateBean2> ruleKieStateDesc =
            new MapStateDescriptor<String, RuleStateBean2>("ruleKieState", String.class, RuleStateBean2.class);


    public static final MapStateDescriptor<String, RuleParam> ruleParaStateDesc =
            new MapStateDescriptor<String, RuleParam>("ruleParaState", String.class, RuleParam.class);

    public static final ListStateDescriptor<LogBean> eventStateDesc = new ListStateDescriptor<>("eventState", LogBean.class);
}
